/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package be.hogent.iii.project.guigameroom;

import java.awt.Color;
import java.awt.Dimension;
import javax.swing.JPanel;

/**
 *
 * @author jef donders
 */
public class GameRoomGui extends JPanel {
    
    private InfoGamePanel infoGamePanel;
    private TabbedPanePanel tabbedPanePanel;
    private ChatPanel chatPanel;
        
    public GameRoomGui(Dimension size){
        vulPaneel(size);
        //this.setBackground(new Color(155,0,255,125));
    }
    
    public void vulPaneel(Dimension size){
        
        
        Dimension tabbedPaneGrootte = new Dimension(size.width/3 -30 ,size.height -5 );
        Dimension chatPaneGrootte = new Dimension (2*size.width /3 -10, size.height/3 );
        Dimension infoPaneGrootte = new Dimension (2*size.width /3 -10, 2 * size.height/3 -20);
        
        
        infoGamePanel = new InfoGamePanel(infoPaneGrootte);
        tabbedPanePanel = new TabbedPanePanel(this, tabbedPaneGrootte);
        chatPanel = new ChatPanel();
        
        
        //ChatPanel tabbedPanePanel = new ChatPanel();
        
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()                
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(infoGamePanel, infoPaneGrootte.width, infoPaneGrootte.width, infoPaneGrootte.width)
                    .addComponent(chatPanel, chatPaneGrootte.width, chatPaneGrootte.width, chatPaneGrootte.width))
                .addContainerGap()
                .addComponent(tabbedPanePanel, tabbedPaneGrootte.width, tabbedPaneGrootte.width, tabbedPaneGrootte.width))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                    .addComponent(infoGamePanel, infoPaneGrootte.height, infoPaneGrootte.height, infoPaneGrootte.height )
                    .addContainerGap()
                    .addComponent(chatPanel, chatPaneGrootte.height, chatPaneGrootte.height, chatPaneGrootte.height))
                .addComponent(tabbedPanePanel , tabbedPaneGrootte.height, tabbedPaneGrootte.height, tabbedPaneGrootte.height)
        );
                            
                       
                          
        /*layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(infoGamePanel, javax.swing.GroupLayout.PREFERRED_SIZE, 390, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(tabbedPanePanel, javax.swing.GroupLayout.DEFAULT_SIZE, 106, Short.MAX_VALUE))
                    .addComponent(chatPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 502, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(infoGamePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(tabbedPanePanel, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(chatPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 195, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );*/
    }

    public void setInfoPanel(String nickname){
        infoGamePanel.setInhoudSpeler(nickname);
    }
    
}
